import { VxeGridProps } from 'vxe-table';
import { DeviceVo } from '@/api/device/types';

export function getTableConfig(): VxeGridProps<DeviceVo> {
  return {
    id: 'tenant',
    loading: false,
    height: 'auto',
    autoResize: true,
    border: 'inner',
    resizable: true,
    showOverflow: 'tooltip',
    stripe: true,
    rowConfig: {
      isHover: true,
      keyField: 'id'
      // height: 56
    },
    customConfig: {
      storage: true
    },
    columns: [
      { title: '序号', type: 'seq', width: 50 },
      // { sortable: true, field: 'deviceName', title: '设备名称', width: 180 },
      // { sortable: true, field: 'deviceId', title: '设备ID', width: 180 },
      { sortable: true, field: 'deviceNo', title: '机器名' },
      { sortable: true, field: 'stationName', title: '关联站房' },
      { sortable: true, field: 'regionName', title: '区域' },
      { sortable: true, field: 'deviceType', title: '设备类型', slots: { default: 'type' } },
      { sortable: true, field: 'createTime', title: '安装时间' },
      { sortable: true, field: 'status', title: '状态', slots: { default: 'status' } },
      { sortable: true, field: 'operationalMode', title: 'TODO 调试模式', slots: { default: 'mode' } },
      { sortable: true, field: 'handle', title: '操作', width: 140, slots: { default: 'handle' } }
    ],
    data: [] as DeviceVo[]
  };
}
